// pages/my-bad/my-bad.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    current: 1,
    pageSize: 20,
    list: [{

      "success": true,
      "code": 0,
      "message": "string",
      "data": {
        "pageTotal": 0,
        "total": 0,
        "rows": [
          {
            "id": "string",
            "houseId": "string",
            "repairItemName": "string",
            "repairItemId": "string",
            "mobile": "string",
            "appointment": "2022-10-01",
            "description": "string",
            "attachment": [
              {
                "id": "string",
                "url": "string"
              }
            ],
            "status": 0
          }
        ]
      }
    }]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {
    this.getBadList()
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady() {

  },
  async getBadList() {
    wx.$http.header = { Authorization: wx.getStorageSync('token') }
    console.log(wx.getStorageSync('token'));
    let res = await wx.$http.get('/repair', { current: this.data.current, pageSize: this.data.pageSize })
    console.log(res);
    // this.setData({
    //   isVerificationCode: res.data.data.code,
    //   mobile: this.data.userPhone
    // })

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage() {

  }
})